package com.stlm2.dems.user.entity;

/**
 * Created by ZLQ on 2017/7/11.
 */
public enum  UserRolePrivilegeType {
    //1：资源分配为角色 2：资源分配给用户
    PrivilegeGiveRole(1) {
        public String toString() {
            return "资源分配为角色";
        }
    },
    PrivilegeGiveUser(2) {
        public String toString() {
            return "资源分配给用户";
        }
    };

    private final int val;

    UserRolePrivilegeType(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static UserRolePrivilegeType getByIntValue(int n) {
        switch (n) {
            case 1:
                return PrivilegeGiveRole;
            case 2:
                return PrivilegeGiveUser;
            default:
                return null;
        }
    }
}
